package com.ghsc.ghxc.jsb.ui.message.view

import android.content.Context
import android.widget.TextView
import com.cn.appcore.ext.setSingleClickListener
import com.ghsc.ghxc.jsb.R
import com.lxj.xpopup.core.BottomPopupView

/**
 * 项目：GuoHuaMall
 * 包名：com.ghsc.ghxc.ui.home.view
 * 类名：RedTypePopupView
 * 创建时间：2023/8/3 13:29
 * 创建人 @author： xiaolin
 * 描述 ：Todo...
 */
class RedTypePopupView (context: Context,
                        type1Confirm:()->Unit,
                        type2Confirm:()->Unit,
) : BottomPopupView(context) {


    private var type1Confirm: () -> Unit = type1Confirm
    private var type2Confirm: () -> Unit = type2Confirm


    override fun getImplLayoutId() = R.layout.pw_red_type
    private val mContext = context

    override fun onCreate() {
        super.onCreate()
        findViewById<TextView>(R.id.tvType1).setSingleClickListener {
            type1Confirm.invoke()
            dismiss()
        }
        findViewById<TextView>(R.id.tvType2).setSingleClickListener {
            type2Confirm.invoke()
            dismiss()
        }
        findViewById<TextView>(R.id.tvBtnCancel).setSingleClickListener {
            dismiss()
        }

    }
    override fun getMaxWidth() = 0
}